Ext.namespace('VAS');
/**
 * @extends Ext.ButtonGroup
 * @author liwen 2011-6-28 1:02
 */
VAS.DynamicButtons = function($config) {
	var _this = this;
	var _config = $config || {};
	_this.callback = function($responseText){
		var b = $responseText;
		var _tbLength = b.items.length;
		for(var i = 0;i<b.length;i++){
			_this.add({text : b.tbar[i].text , handler : b.tbar[i].action});
		}
	}
	var thisConfig = {
		listeners:{
			render:function(){
				if(!Ext.isEmpty(_config.url)){
					AjaxDelegate(_config.url,_this.callback,{},'return');
				}else{
					alert("need url that can created");
				}
			}
		}
	};
	Ext.apply(_this, Ext.apply(thisConfig, _config));
	VAS.DynamicButtons.superclass.constructor.call(_this);
};
Ext.extend(VAS.DynamicButtons,Ext.Ext.ButtonGroup);
Ext.reg('dynamicbuttons',VAS.DynamicButtons);



